<template>
    <div id="web-app">
        <el-config-provider :locale="zhCn">
          <RouterView/>
        </el-config-provider>
    </div>
</template>
<script lang="ts" setup>
//ElementPlus语言配置
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
//引入cookie
import { getCookie } from "@/utils/cookie";
//引入Pinia
import useUserStore from '@/store/user.ts';
const userStore: any = useUserStore();

onMounted(() => {
  //判断是否登录
  if(!userStore.userName) {
    if (getCookie("userName")) {
      userStore.setUserName();
    }
  } 
});
</script>
<style scoped>
#web-app {
  width: 100%;
  height: 100%;
}
</style>
